package org.zht.dormpro.dorm.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.zht.dormpro.dorm.model.TbWord;

public interface TbWordMapper {
    @Delete({
        "delete from tb_word",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into tb_word (id, stu_id, ",
        "remark, record_time, ",
        "record_append, record_status)",
        "values (#{id,jdbcType=INTEGER}, #{stuId,jdbcType=VARCHAR}, ",
        "#{remark,jdbcType=VARCHAR}, #{recordTime,jdbcType=BIGINT}, ",
        "#{recordAppend,jdbcType=VARCHAR}, #{recordStatus,jdbcType=TINYINT})"
    })
    int insert(TbWord record);

    int insertSelective(TbWord record);

    @Select({
        "select",
        "id, stu_id, remark, record_time, record_append, record_status",
        "from tb_word",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("org.zht.dormpro.dorm.mapper.TbWordMapper.BaseResultMap")
    TbWord selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(TbWord record);

    @Update({
        "update tb_word",
        "set stu_id = #{stuId,jdbcType=VARCHAR},",
          "remark = #{remark,jdbcType=VARCHAR},",
          "record_time = #{recordTime,jdbcType=BIGINT},",
          "record_append = #{recordAppend,jdbcType=VARCHAR},",
          "record_status = #{recordStatus,jdbcType=TINYINT}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(TbWord record);
}